package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("demo.sf");
        String str = "阿斯蒂芬社交电商就开始吃";
        byte[] bytes = str.getBytes(StandardCharsets.UTF_8);
        fos.write(bytes);
        str = "恭喜啊身心健康现金啊显卡";
        bytes = str.getBytes(StandardCharsets.UTF_8);
        fos.write(bytes);
        System.out.println("读写完毕！");
        fos.close();
    }
}
